package storyforkids.main;

import java.io.File;

import android.app.Application;
import android.content.SharedPreferences;

public class StoryForKidsApplication extends Application {
	public String currentDirectory = "/sdcard/";
	public String currentFile = null;
	public int currentPage = 0;
	
	public void loadSetting(){
		SharedPreferences prefs;
		prefs = getSharedPreferences("myPref", MODE_PRIVATE);
		currentDirectory = prefs.getString("currentDirectory", currentDirectory);
		currentFile = prefs.getString("currentFile", currentFile);
		currentPage = prefs.getInt("currentPage", currentPage);
	}
	
	public void saveSetting(){
		SharedPreferences prefs;
		prefs = getSharedPreferences("myPref", MODE_PRIVATE);
		SharedPreferences.Editor editor = prefs.edit();
		editor.putString("currentDirectory", currentDirectory);
		editor.putString("currentFile", currentFile);
		editor.putInt("currentPage", currentPage);
		editor.commit();
	}
	
}
